import { Component, OnInit } from '@angular/core';
import { TodoService } from '../../services/todo.service'

@Component({
  selector: 'app-todo',
  templateUrl: './todo.component.html',
  styleUrls: ['./todo.component.less']
})
export class TodoComponent implements OnInit {

  constructor(
    public todoService: TodoService
  ) { }

  ngOnInit() {
  }

  onAdd(event) {
    this.todoService.addTodo(event)
  }

  onDel(id: number) {
    this.todoService.delTodo(id)
  }
}
